package com.qf.service.impl;

import com.qf.mapper.CarMapper;
import com.qf.pojo.Car;
import com.qf.service.CarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class CarServiceImpl implements CarService {
    @Autowired
    private CarMapper carMapper;
    @Override
    public List<Car> findAll(Integer cid) {

        List<Car> list = carMapper.findAllCar(cid);
        if (list != null){
            return list;
        }
        return null;
    }

    @Override
    public List<Car> findAllByNumber(Integer cid) {
        List<Car> list = carMapper.findAllCarByNumber(cid);
        if (list!=null){
            return list;
        }
        return null;
    }

    @Override
    public Car findCarById(Integer id) {
        Car car = carMapper.selectCarById(id);
        if (car!=null){
            return car;
        }
        return null;
    }
}
